package com.example.sunmiv1.views;

import android.content.Context;
import android.util.AttributeSet;

import com.google.android.flexbox.FlexboxLayoutManager;

public class RecyclerViewNoScrollUtil extends FlexboxLayoutManager {

    private boolean isScrollEnabled = true;

    public RecyclerViewNoScrollUtil(Context spanCount) {
        super(spanCount);
    }

    public RecyclerViewNoScrollUtil(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public void setScrollEnabled(boolean flag) {
        this.isScrollEnabled = flag;
    }

    @Override
    public boolean canScrollVertically() {
        return isScrollEnabled && super.canScrollVertically();
    }

}
